package castle_components
{
	import flash.display.MovieClip;
	import units.Unit;
	
	public class Training_Building extends MovieClip
	{
		public var base_x,base_y;
		public var BASE_WIDTH,BASE_HEIGHT;
		public var game_handler:GameHandler,castle:Castle;
		public var registered_unit_1;
		public function Training_Building()
		{
			super();
			base_x = this.x
			BASE_WIDTH = this.width;
			base_y = this.y;
			BASE_HEIGHT = this.height;
			
		}
		public function register(u:Unit){
			if(registered_unit_1 == null){
				registered_unit_1 = u;
				u.inside_of = this;
				u.x = this.x + game_handler.castle_center.x + 22;
				u.y = this.y + game_handler.castle_center.y + 10;
				return true;
			}else u.go_home();
			return false;
		}
		public function unregister(u:Unit){
			if(registered_unit_1 == u)
				registered_unit_1 = null;
		}
		
	}
}